@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal" id="peopleInfoForm">

            <div class="row">
                <input type="hidden" id="orgId" value="${org.id}">
                <input type="hidden" id="uploadUrl" value="${uploadUrl}">
                <input type="hidden" id="userType" value="5">
                <div class="col-sm-6 b-r">
                    <#input id="orgName" name="所属学校" value="${org.name}" underline="true" disabled="disabled"/>
                    <#select id="gradeId" name="年级" underline="true" onchange="gradeRelationParentA();">
                    <option value="">请选择...</option>
                </#select>

                <div class="form-group">
                    <label class="col-sm-3 control-label" >子女姓名  <span style="color: red; ">*</span></label>
                    <select id ="studentId" name="studentId" class="selectpicker col-sm-9 "  style="float: right;color: white" data-live-search="true" onclick="initStulist()">
                    </select>
                </div>
                    <#input id="cellphone" name="手机" underline="true" span="true"/>
                <#select id="papersType" name="证件类型" underline="true">
                @for(papersType in GBPapersType){
                <option value="${papersType.code}">${papersType.cname}</option>
                @}
            </#select>
              <#input id="nativePlace" name="籍贯" underline="true"/>
                    <#input id="birthday" name="出生日期" underline="true"/>
                    <#input id="telephone" name="联系电话" underline="true"/>
                    <#input id="postCode" name="邮编" underline="true"/>

                </div>

                <div class="col-sm-6">
                    <#select id="phaseId" name="学段" underline="true" onchange="phaseRelationParentA();">
                    <option value="">请选择...</option>
                    @for(phaseMeta in phaseList){
                    <option value="${phaseMeta.id}">${phaseMeta.name}</option>
                    @}
                </#select>
              <#select id="classId" name="班级" underline="true" onchange="classRelationParent();">
              <option value="">请选择...</option>
             </#select>
                 <#input id="name" name="家长姓名" underline="true" span="true"/>
                    <#select id="sex" name="性别" underline="true">
                    @for(sex in GBSex){
                    <option value="${sex.code}">${sex.cname}</option>
                    @}
                </#select>
               <#input id="papersNumber" name="证件号码" underline="true" />
                <#select id="nationCode" name="民族" underline="true">
                <option value="">请选择</option>
                @for(nation in GBNation){
                <option value="${nation.code}">${nation.cname}</option>
                @}
            </#select>
         <#input id="familyAddress" name="家庭地址" underline="true"/>
            <#input id="email" name="电子邮箱" underline="true"/>

               <#avatar  id="avatar" name="上传头像"/>
                </div>
            </div>

            <div class="row btn-group-m-t">
                <div class="col-sm-10" style="text-align: center">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="PtPeopleInfoDlg.addSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="PtPeopleInfoDlg.close()"/>
                </div>
            </div>
        </div>

    </div>
</div>
<script src="${ctxPath}/static/modular/system/ptPeople/ptPeople_info.js"></script>
<script>

    laydate.render({
        elem: '#birthday'
    });
    $(function() {
        $(".selectpicker").selectpicker({
            noneSelectedText: '请点击显示' //默认显示内容  
        });
    })
    //绑定bootstrap-select事件
    $(".selectpicker").on('shown.bs.select',function(e){
        initStulist();
    });
    function initStulist() {
        $.ajax({
            type: "post",
            url:Feng.ctxPath+'/ptPeople/suggestStudentList',
            data:{'orgId':$("#orgId").val(),"classId":$("#classId").val()},
            async:false,
            dataType: "json",
            success: function(data){
                var studentList = data;
                if (studentList.length>0) {
                    var studentNameStr ='<option value=""></option>';
                    for (var i = 0; i < studentList.length; i++) {
                        studentNameStr += "<option value='" +studentList[i].userId + "' ";
                        studentNameStr += ">" + studentList[i].userName + "</option>";
                    }
                    $("#studentId").html(studentNameStr);
                    //必须加，刷新select
                    $("#studentId").selectpicker('refresh');
                }
            }
        });

    }
</script>
@}
